package com.quanshu.exchange.ui.gui.message.chat.row.viewholder;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.hyphenate.chat.EMMessage;
import com.hyphenate.chat.EMTextMessageBody;
import com.quanshu.exchange.R;
import com.quanshu.exchange.ui.gui.message.chat.row.BaseChatRowViewHolder;

// 接收文本消息ViewHolder
public class TextReceiveViewHolder extends BaseChatRowViewHolder {
    TextView content;

    public TextReceiveViewHolder(Context context, View view) {
        super(context, view);
        content = view.findViewById(R.id.chat_content);
    }

    @Override
    public void setViewInfo(EMMessage chatMessage, EMMessage preMessage, String groupOwner) {
        super.setViewInfo(chatMessage, preMessage, groupOwner);
        // 设置内容
        EMTextMessageBody txtBody = (EMTextMessageBody) chatMessage.getBody();
//            Spannable span = EmojiUtils.getSmiledText(context, txtBody.getMessage());
//            content.setText(span, TextView.BufferType.SPANNABLE);
        content.setText(txtBody.getMessage());
    }
}